<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>果蔬集市</title>
    <link rel="stylesheet" type="text/css" href="jsp/gsjs.css"/>
    <link rel="stylesheet" type="text/css" href="jsp/swiper.min.css"/>
    <script src="jsp/jquery.min.js"></script>
    <script src="jsp/distpicker.data.js" type="text/javascript" charset="utf-8"></script>
    <script src="jsp/distpicker.js" type="text/javascript" charset="utf-8"></script>
    <script src="jsp/gsjs.js" type="text/javascript" charset="utf-8"></script>
    <script src="jsp/swiper.min.js" type="text/javascript" charset="utf-8"></script>

    <script src="jsp/es6-shim.min.js"></script>
    <script src="jsp/jquery-3.3.1.min.js"></script>
    <script src="jsp/jquery.transit.min.js"></script>
    <script src="jsp/easyhelper.min.js"></script>
    <link rel="stylesheet" href="jsp/easyhelper.min.css">
</head>
<body>
<a href="" name="here"></a>
<div id="top">
    <div id="topz">
        <div id="top1">
            <img src="jsp/YNIK%7BT%60J8AT~PQ(8LL9QPJR.png">
        </div>
        <div id="top2">
            <a href="/jumpindex" id="top21">集市首页</a>
        </div>
        <div id="top3">
            <span>欢迎来到本集市，开启新鲜水果之旅！</span>
        </div>
        <div id="top4" style="width: 100px;margin-left: 300px">
            <#if userInfo??>
            <a href="login.html" id="top41">你好;${userInfo.username}
                <input id="userid" value="${abc.userid}" type="text" style="display: none">
            </a>
            <#else>
            <a href="login.html" id="top41">请登录</a>
        </#if>
    </div>
    <div id="top5">
        <a href="register.html" id="top51">免费注册</a>
    </div>
    <div id="top6">
        <a href="/jumpmygoods" id="top61">我的订单</a>
    </div>
    <div id="top7">
        <a href="" id="top71">商家支持</a>
    </div>
    <div id="top8">
        <a href="" id="top81" onmouseover="over()" onmouseout="out()">网站导航</a>
    </div>
    <div id="top9" onmouseover="over()" onmouseout="out()">
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
        <div id="wzdh1">
            <a href="蔬果集市帮助中心.html" id="wzdh11">帮助中心</a>
        </div>
    </div>
</div>

</div>

<div id="banner">
    <div id="banner4" style="margin-left: 269px;margin-top: 30px">
        <div data-toggle="distpicker">
            <select id="s"></select>
            <select id="j"></select>
            <select id="x"></select>
        </div>
    </div>
    <div id="banner1" style="width: 560px">
        <form action="http://www.baidu.com/s" method="post">
            <input type="text" name="wd" id="banner2" value="" size="70" placeholder="请输入您喜爱的水果"
                   style="line-height: 20px;margin-top: 3px;"/>
            <input type="submit" id="banner3" value="搜索"/>
        </form>
    </div>
</div>


<div id="main">
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide"><img src="jsp/0001-172102458_20201005_222027_0000.png" id="pa1"></div>
            <div class="swiper-slide"><img src="jsp/124.png" id="pa2"></div>
            <div class="swiper-slide"><img src="jsp/20201005_225157_0000.png" id="pa3"></div>
        </div>
        <!-- 如果需要分页器 -->
        <div class="swiper-pagination"></div>

        <!-- 如果需要导航按钮 -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>

        <!-- 如果需要滚动条 -->
        <!-- <div class="swiper-scrollbar"></div> -->
    </div>
</div>
<div id="main2" style="height: 2700px">
    <div id="fl1" style="height: 2700px">
        <#list list as list >
            <#if list.goodsid%5==1>
                <#if list.goodsid==1>
                    <div id="ti1" style="float: left">
                        <a href="" name="e1"></a>
                        <span>新鲜特卖</span>
                    </div>
                <#elseif list.goodsid==6>
                    <div id="ti1" style="float: left">
                        <a href="" name="e2"></a>
                        <span>西北特色</span>
                    </div>
                <#elseif list.goodsid==11>
                    <div id="ti1" style="float: left">
                        <a href="" name="e3"></a>
                        <span>热带风味</span>
                    </div>
                <#elseif list.goodsid==16>
                    <div id="ti1" style="float: left">
                        <a href="" name="e4"></a>
                        <span>海边特产</span>
                    </div>
                <#elseif list.goodsid==21>
                    <div id="ti1" style="float: left">
                        <a href="" name="e5"></a>
                        <span>田间直送</span>
                    </div>
                </#if>
            </#if>
            <div id="main3">
                <div id="goods1">
                    <img src="${list.goodspic}" id="tu1" onclick="pic(this)" name="${list.goodsid}">
                    <span name="${list.goodsid *10 +1}" style="display: none">
                                ${list.goodsid}
                        </span>
                    <span name="${list.goodsid *10 +1}" style="display: none">
                                ${list.goodscount}
                        </span>
                    <span id="jj1" name="${list.goodsid *10 +1}">
                           ${list.goodsname}
                        </span>
                    <span id="jj2" name="${list.goodsid *10 +1}">
                                ${list.goodsdesc}
                        </span>
                    <span name="${list.goodsid *10 +1}" style="display: none">
                                ${list.goodspic}
                        </span>
                </div>
                <div id="document1">

                    <div id="tj1">
                                <span id="tj11">
                                    83天历史最低价
                                </span>
                    </div>
                    <div id="tj2">
                                <span id="tj21">
                                    已售<span id="tj22">
                                        120
                                    </span>件
                                </span>
                    </div>
                    <div id="tj3">
                                <span id="tj31">
                                    ￥
                                </span>
                        <span id="tj32" name="${list.goodsid *10 +1}">
                                    ${list.goodsprice}
                                </span><br>
                        <del>
                                <span id="tj33">
                                    ￥
                                </span>
                            <span id="tj34">
                                    59
                                </span></del>
                    </div>
                    <div class="wrapper">
                        <button class="helper-button-info" id="dialog-success" style="background-color: red;border: 1px solid red;
                                    margin-top: 20px; margin-left: 15px;" onclick="down(this)" name="${list.goodsid}">立即抢购
                        </button>
                    </div>

                </div>
            </div>
        </#list>
    </div>
</div>
<div id="bottom">
    <div id="bottom1">

    </div>
    <div id="bottom2">
        <div id="bottom21">
            <br>
            <span><a href="" class="bm1 gg"><b>购物指南</b></a></span><br>
            <br>
            <span><a href="" class="bm11 gg1">购物流程</a></span><br>
            <span><a href="" class="bm12 gg1">会员介绍</a></span><br>
            <span><a href="" class="bm13 gg1">生活旅行</a></span><br>
            <span><a href="" class="bm14 gg1">常见问题</a></span><br>
            <span><a href="" class="bm15 gg1">联系客服</a></span><br>
        </div>
        <div id="bottom22">
            <br>
            <span><a href="" class="bm2 gg"><b>配送方式</b></a></span><br>
            <br>
            <span><a href="" class="bm21 gg1">上门自提</a></span><br>
            <span><a href="" class="bm22 gg1">211限时达</a></span><br>
            <span><a href="" class="bm23 gg1">配送服务查询</a></span><br>
            <span><a href="" class="bm24 gg1">配送费收取标准</a></span><br>
            <span><a href="" class="bm25 gg1">海外配送</a></span><br>
        </div>
        <div id="bottom23">
            <br>
            <span><a href="" class="bm3 gg"><b>支付方式</b></a></span><br>
            <br>
            <span><a href="" class="bm31 gg1">货到付款</a></span><br>
            <span><a href="" class="bm32 gg1">在线支付</a></span><br>
            <span><a href="" class="bm33 gg1">分期付款</a></span><br>
            <span><a href="" class="bm34 gg1">公司转账</a></span><br>
        </div>
        <div id="bottom24">
            <br>
            <span><a href="" class="bm4 gg"><b>售后服务</b></a></span><br>
            <br>
            <span><a href="" class="bm41 gg1">售后政策 </a></span><br>
            <span><a href="" class="bm42 gg1">价格保护 </a></span><br>
            <span><a href="" class="bm43 gg1">退款说明 </a></span><br>
            <span><a href="" class="bm44 gg1">返修/退换货 </a></span><br>
            <span><a href="" class="bm45 gg1">取消订单</a></span><br>
        </div>
        <div id="bottom25">
            <br>
            <span><a href="" class="bm5 gg"><b>特色服务</b></a></span><br>
            <br>
            <span><a href="" class="bm51 gg1">夺宝岛 </a></span><br>
            <span><a href="" class="bm52 gg1">DIY装机 </a></span><br>
            <span><a href="" class="bm53 gg1">延保服务 </a></span><br>
            <span><a href="" class="bm54 gg1"></a></span><br>
            <span><a href="" class="bm55 gg1"></a></span><br>
        </div>
    </div>
    <div id="bottom3">

    </div>
</div>
<div id="left">
    <span><a href="#here">返回顶部</a></span><br>
    <br>
    <br>
    <span><a href="#e1">新鲜特卖</a></span><br>
    <br>
    <span><a href="#e2">西北特色</a></span><br>
    <br>
    <span><a href="#e3">热带风味</a></span><br>
    <br>
    <span><a href="#e4">海边特产</a></span><br>
    <br>
    <span><a href="#e5">田间直送</a></span><br>

</div>

</body>
<script type="text/javascript">
    window.onload = function () {
        var mySwiper = new Swiper('.swiper-container', {
            direction: 'horizontal',
            autoplay: '3000',
            parallax: true,
            loop: true,
            effect: 'fade',
            fade: {
                crossFade: false,
            },

            // 如果需要分页器
            pagination: '.swiper-pagination',

            // 如果需要前进后退按钮
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',

            // 如果需要滚动条
            //scrollbar: '.swiper-scrollbar',
        })
    }
</script>
<script type="text/javascript">
    function down(n) {
        var x = n.name;
        var y = document.getElementsByName(x * 10 + 1);
        var goodsid = y[0].innerHTML;
        var goodscount = y[1].innerHTML;
        $.ajax({
            url: ("/addCar"),
            type: "post",
            data: {
                goodsid: goodsid,
                goodscount: goodscount,
                userid: $("#userid").val()
            },
            dataType: "text",
            success: function (data) {
                if (data == "添加成功") {
                    alert("成功加入购物车,您可以去购物车结算")
                    location.assign("/jumpmygoods")
                } else {
                    location.href = "login.html";
                }
            }
        })
    }

    function pic(n) {
        var x = n.name;
        var y = document.getElementsByName(x * 10 + 1);
        var goodsid = y[0].innerHTML;
        var goodscount = y[1].innerHTML;
        var goodsname = y[2].innerHTML;
        var goodsdesc = y[3].innerHTML;
        var goodspic = y[4].innerHTML;
        var goodsprice = y[5].innerHTML;
        $.ajax({
            url: ("/goodsdetails"),
            type: "post",
            data: {
                goodsid: goodsid,
                goodscount: goodscount,
                goodsname: goodsname,
                goodsprice: goodsprice,
                goodspic: goodspic,
                goodsdesc: goodsdesc
            },
            dataType: "text",
            success: function (data) {
                if (data == "login") {
                    location.href = "login.html";
                } else {
                    location.href = "/goodsdetailspage";
                }
            }
        })
    }
</script>
</html>